<script setup>
import {RouterView, useRoute} from 'vue-router'
import CommonPageHeader from "@/components/CommonPageHeader.vue";
import HomeHeader from "@/components/HomeHeader.vue";

// 获取当前的路由路径
const route = useRoute();

</script>

<template>
  <div id="basic_layout">
    <a-layout style="min-height: 100vh;">
      <a-layout-header class="header">
        <!-- 这里可以v-if判断接收的分类是什么来决定用哪个头部 -->
        <HomeHeader v-if="route.meta.homeHeader"/>
        <CommonPageHeader v-else/>
      </a-layout-header>
      <a-layout-content class="content">
        <RouterView />
      </a-layout-content>
      <a-divider />
      <a-layout-footer class="footer">
        <a href="" target="_blank">备案号 - 暂无</a>
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<style scoped>
#basic_layout .header {
  background: linear-gradient(to right, white, #d0ebff);
  color: unset;
  padding-inline: 0;
}

#basic_layout .content {
  background: linear-gradient(to right, #fefefe, #fff);

}

#basic_layout .footer {
  background: linear-gradient(to right, #fefefe, #fff);
  padding: 16px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
}
</style>
